#!/bin/bash

#echo "	███╗░░██╗██╗░██████╗░██╗░░██╗████████╗  ███████╗██╗██╗░░░░░████████╗███████╗██████╗░"
#echo "	████╗░██║██║██╔════╝░██║░░██║╚══██╔══╝  ██╔════╝██║██║░░░░░╚══██╔══╝██╔════╝██╔══██╗"
#echo "	██╔██╗██║██║██║░░██╗░███████║░░░██║░░░  █████╗░░██║██║░░░░░░░░██║░░░█████╗░░██████╔╝"
#echo "	██║╚████║██║██║░░╚██╗██╔══██║░░░██║░░░  ██╔══╝░░██║██║░░░░░░░░██║░░░██╔══╝░░██╔══██╗"
#echo "	██║░╚███║██║╚██████╔╝██║░░██║░░░██║░░░  ██║░░░░░██║███████╗░░░██║░░░███████╗██║░░██║"
#echo "	╚═╝░░╚══╝╚═╝░╚═════╝░╚═╝░░╚═╝░░░╚═╝░░░  ╚═╝░░░░░╚═╝╚══════╝░░░╚═╝░░░╚══════╝╚═╝░░╚═╝"
#echo "                                                               Created by Delson        "
RAND="redshift"
dpkg -s $RAND &> /dev/null

if [ $? -eq 0 ]; then
    echo "Package  is installed!"
else
    sudo apt-get install redshift -y
    sudo apt-get install redshift-gtk -y
    clear
    echo "Successfully Installed"

fi



while [ $? -eq 0 ]
value=$1
do
    if [ "$value" -ge 2000 ] && [ "$value" -le 6500 ]; then
            redshift -l 18.969049:72.821182 -t $value:$value
            killall redshift
            
            break
    else
            echo "***Enter values between 2000 to 6000*** "
            echo "***Preferably set the value to 4000 ***"
    fi
done